package com.eiisan.web.web.feign;

import com.alibaba.fastjson.JSONObject;
import com.eiisan.core.util.api.Result;
import com.eiisan.web.feign.PayMentTransacClientApi;
import com.eiisan.web.model.dto.PayMentTransacDTO;
import com.eiisan.web.service.PayMentTransacService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gragonfly
 * @date 2019/7/17
 **/
@RestController
@Api(tags = "API - PayMentTransacFeign")
public class PayMentTransacClient implements PayMentTransacClientApi {
    @Autowired
    PayMentTransacService payMentTransacService;

    /**
     * 根据不同的渠道id(支付方式) 返回不同的支付提交表单
     * @param channelId
     * @param payToken
     * @return
     */
    public Result<JSONObject> toPayHtml(String channelId, String payToken) {
       return payMentTransacService.toPayHtml(channelId, payToken);
    }

    @Override
    public Result<PayMentTransacDTO> tokenByPayMentTransac(String token) {
       return payMentTransacService.tokenByPayMentTransac(token);
    }

}
